package cn.edu.zxj.trans.service;

import cn.edu.zxj.trans.mapper.LogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-02-03
 * @time: 11:44:32
 */
@Service
@Slf4j
public class LogService {
    @Autowired
    private LogMapper logMapper;

    Integer insert(String userName, String op) {
        try {
            return logMapper.insert(userName, op);
        } catch (Exception e) {
            log.error("插入日志出现错误, e: {}", e);
            return -1;
        }
    }
}
